<?php
/*
If you would like to edit this file, copy it to your current theme's directory and edit it there.
Theme My Login will always look in your theme's directory first, before using this default template.
*/
if (isset($_REQUEST['updated']) && $_REQUEST['updated'] == 'true') {
		if ( $template->get_option( 'register-success' ) )
			$templates[] = $template->get_option( 'register-success' );
		$templates[] = 'register-success.php';
		$template->get_template( $templates );
	} else if (get_user_option('default_password_nag')) {
?>
<div class="login profile"
	id="theme-my-login<?php $template->the_instance(); ?>">
	<?php $template->the_action_template_message( 'profile' ); ?>
	<?php $template->the_errors(); ?>
	<ul class="login-profile-step">
	<li><?php _e('Send register email', 'theme-my-login');?></li>
	<li><?php _e('Complete registration information', 'theme-my-login');?></li>
	<li><?php _e('register success', 'theme-my-login');?></li>
	</ul>
	<form id="your-profile"
		action="<?php $template->the_action_url( 'profile' ); ?>"
		method="post"
		onsubmit="return validate_form(this);">
		<?php wp_nonce_field( 'update-user_' . $current_user->ID ); ?>
			<input type="hidden" name="from" value="profile" /> 
			<input
				type="hidden" name="checkuser_id"
				value="<?php echo $current_user->ID; ?>" />

		<?php if ( has_action( 'personal_options' ) ) : ?>

		<h3><?php _e( 'Personal Options' ); ?></h3>

		<table class="form-table">
		<?php do_action( 'personal_options', $profileuser ); ?>
		</table>

		<?php endif; ?>

		<?php do_action( 'profile_personal_options', $profileuser ); ?>

		<h3><?php _e( 'Basic Information (must required)', 'theme-my-login'); ?></h3>
		<table class="form-table">
			<tr>
				<th><label class="user_login"><?php _e( 'profile username:', 'theme-my-login'); ?></label></th>
				<td><div type="text" name="user_login1" id="user_login1"
					disabled="disabled" class="regular-text" ><?php echo esc_attr( $profileuser->user_login ); ?> </div></td>
			</tr>
			<tr>
				<th><label class="user_email"><?php _e( 'Email:', 'theme-my-login'); ?></label></th>
				<td><div type="text" name="email" id="email" class="email"
					disabled="disabled" class="regular-text" > <?php echo esc_attr( $profileuser->data->user_email ); ?></div></td>
			</tr>

			<tr>
				<th><label class="nickname"><?php _e( 'Nickname:', 'theme-my-login'); ?></label></th>
				<td><input type="text" name="nickname" id="nickname"
					value="<?php echo esc_attr( $profileuser->nickname ); ?>"
					class="regular-text" /><span id="nickinfo"><?php _e('nickname must be set.', 'theme-my-login')?></span></td>
			</tr>

			<?php
		$show_password_fields = apply_filters( 'show_password_fields', true, $profileuser );
		if ( $show_password_fields ) :
		?>
		<tr id="password">
				<th><label class="pass1"><?php _e( 'New Password:', 'theme-my-login'); ?></label></th>
				<td><input type="password" name="pass1" id="pass1" size="16"
					value="" autocomplete="off" /><span id="pass1info"><?php _e('password must be set.', 'theme-my-login')?></span>
					<p class="tip"><?php _e( 'Hint: The password should be at least seven characters long.',  'theme-my-login'); ?></p>
				</td>
			</tr>
			
			<tr id="password">
				<th><label class="pass1"><?php _e( 'Confirm Password:', 'theme-my-login'); ?></label></th>
				<td><input type="password" name="pass2" id="pass2" size="16" value=""
					autocomplete="off" /><span id="pass2info"><?php _e('Two passwords do not match.', 'theme-my-login')?></span></br>
					<div id="pass-strength-result"><?php _e( 'Strength indicator', 'theme-my-login' ); ?></div>
				</td>
			</tr>
		<?php endif; ?>
		
		</table>


		<h3><?php _e( 'About Yourself(Optional)', 'theme-my-login'); ?></h3>

		<table class="form-table">
			<tr>
				<th><label class="first_name"><?php _e( 'First Name:', 'theme-my-login'); ?></label></th>
				<td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profileuser->first_name ); ?>" class="regular-text" /></td>
			</tr>
			<tr>
				<th><label class="description"><?php _e( 'Biographical Info:', 'theme-my-login' ); ?></label></th>
				<td><textarea name="description" id="description" rows="5" cols="7"><?php echo esc_html( $profileuser->description ); ?></textarea><br />
					<span class="description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></span></td>
			</tr>
		</table>

		<?php do_action( 'show_user_profile', $profileuser ); ?>

		<p class="submit">
			<input type="hidden" name="action" value="profile" /> <input
				type="hidden" name="instance"
				value="<?php $template->the_instance(); ?>" /> <input type="hidden"
				name="user_id" id="user_id"
				value="<?php echo esc_attr( $current_user->ID ); ?>" /> <button
				type="submit" class="button-primary"
				 name="submit" ><?php esc_attr_e( 'Update Profile' ); ?></button>
		</p>
	</form>
</div>
<?php } else {
	wp_safe_redirect(WPUF_container::wpuf_get_container_page_url());
 }?>